package com.gzx.plugin.tjzy.modular.project.belong.controller;

import com.gzx.plugin.tjzy.modular.project.belong.entity.vo.GzxBelongUserVo;
import com.gzx.plugin.tjzy.modular.project.belong.service.GzxProjectBelongService;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import vip.xiaonuo.common.pojo.CommonResult;

/**
 * 项目信息关联表
 */
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/tjzy/project")
public class GzxProjectBelongController {

    private final GzxProjectBelongService gzxProjectService;

    /**
     * 根据项目code获取关联表信息
     */
    @GetMapping("/belong/{projectCode}")
    public CommonResult<GzxBelongUserVo> queryByCode(@PathVariable String projectCode) {
        return CommonResult.data(gzxProjectService.queryByCode(projectCode));
    }

}
